//
//  TTDianpuManagerViewCell.m
//  TaoTuo
//
//  Created by admin on 2019/11/5.
//  Copyright © 2019 admin. All rights reserved.
//

#import "TTDianpuManagerViewCell.h"
#import "TTDianpuManagerViewController.h"

@interface TTDianpuManagerViewCell ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView *pictureView;

@end

@implementation TTDianpuManagerViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupSubviews];
        
    }
    return self;
}

- (void)setModel:(TTDianpuModel *)model
{
    _model = model;
    self.pictureView.image = [UIImage imageNamed:model.imageName];
    self.titleLabel.text = model.title;
    
}

- (void)setupSubviews
{
    _titleLabel = [UILabel labelTextCenterWithTitle:@"" color:UIColorHex(333333) fontSize:18];
    _titleLabel.layer.backgroundColor = [UIColor whiteColor].CGColor;
    _titleLabel.frame = CGRectMake(46, 10, SCREEN_WIDTH - 70, 80);
    [self.contentView addSubview:_titleLabel];
    
    _titleLabel.layer.cornerRadius = 5;
    _titleLabel.layer.shadowColor = UIColorHex(000000).CGColor;
    _titleLabel.layer.shadowOpacity = 0.15;
    _titleLabel.layer.shadowOffset = CGSizeZero;
    _titleLabel.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:_titleLabel.bounds cornerRadius:5].CGPath;
    
    _pictureView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 20, 60, 60)];
    _pictureView.backgroundColor = UIColorHex(F4CA3A);
    _pictureView.layer.cornerRadius = 5;
    _pictureView.contentMode = UIViewContentModeCenter;
    [self.contentView addSubview:_pictureView];
    
    _pictureView.layer.shadowColor = UIColorHex(000000).CGColor;
    _pictureView.layer.shadowOpacity = 0.15;
    _pictureView.layer.shadowOffset = CGSizeZero;
    _pictureView.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:_pictureView.bounds cornerRadius:5].CGPath;
    
}

@end
